package com.dinree.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.base.library.TopBarBaseActivity;
import com.dinree.R;
import com.dinree.databinding.ActivityAuthenticationBinding;
import com.jakewharton.rxbinding2.view.RxView;

import java.util.concurrent.TimeUnit;

import static com.base.library.Constant.WINDOW_DURATION;

public class AuthenticationActivity extends TopBarBaseActivity {
    private ActivityAuthenticationBinding activityAuthenticationBinding;

    @Override
    public int getContentView() {
        return R.layout.activity_authentication;
    }

    @Override
    public void initContentView(Bundle savedInstanceState) {
        setTitle("选择认证方式");
        setTopLeftButton(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        activityAuthenticationBinding = getContentViewBinding();
        RxView.clicks(activityAuthenticationBinding.btnPersonage).throttleFirst(WINDOW_DURATION, TimeUnit.SECONDS).subscribe(v -> {
            Intent intent = new Intent(mContext, EditRefereeActivity.class);
//            intent.putExtra("type", 1);
            startActivity(intent);
        });
        RxView.clicks(activityAuthenticationBinding.btnCompany).throttleFirst(WINDOW_DURATION, TimeUnit.SECONDS).subscribe(v -> {
            Intent intent = new Intent(mContext, CompanyAuthActivity.class);
//            intent.putExtra("type", 2);
            startActivity(intent);
        });
    }
}

